1. Field of the Invention
The present invention relates to a character generating method and apparatus for developing an outline character, expressed by a logical coordinate system, on physical coordinates expressed by integer values.
2. Description of the Related Art
A printer, a display device or the like requires that character patterns be generated to print or display characters. In the generation of character patterns, recently, characters of various character sizes are demanded even for the same character. Therefore, the memory capacity increases if characters of various character sizes are given for the same character by bit patterns. Particularly, characters having many types of characters like Kanji characters require a large memory capacity.
As a solution to this problem, a method of generating characters by outline fonts is known. According to this method, data of character patterns whose contour lines are expressed in real numbers and also by a logical coordinate system, is provided, and this data is converted to a designated character size coordinate system to develop characters to a bit map image expressed by integer values.
Conventionally, in developing logical coordinate data expressed by real numbers, such as a figure or an outline font, to a bit map image expressed by integer values, a fractional portion of character data is rounded so that the data will be expressed in the units of pixels of a printer or a display. In order to express coordinate data by closest pixels, typical rounding is to count fractions of 5 and over as a whole number.
For example, individual points (contour points) which constitute a Kanji character "Kuruma" expressed in an outline form as shown in FIG. 1, are stored by integer logical coordinates like 1000.times.1000.
Character outline data on the logical coordinates are converted to the necessary character size to have coordinate values including decimal points. If all the points are rounded to express the coordinate values by physical coordinates, all the points will be rounded to the nearest whole numbers. For conversion to a character size of 24.times.24 dots, for example, a Kanji character "Kuruma" shown in FIG. 1 becomes as shown in FIG. 2A through the coordinate conversion and rounding. In this example, since the original character is designed thick, the generated character bit map image has a width of two pixels.
If the same character is converted to have a bit map image of 16 dots in both vertical and horizontal directions (16.times.16 dots), it becomes as shown in FIG. 2B and two adjacent center horizontal strokes contact with each other.
Likewise, when a Kanji character "Kame" expressed in an outline form by logical coordinates of 1000.times.1000, as shown in FIG. 3, is converted to a character size of 16.times.16 dots, it becomes as shown in FIG. 4A.
The Kanji character "Kame" contains three horizontal strokes included in each of two elements "Hi" constituting this Kanji character, one horizontal stroke in the head portion and one horizontal stroke in the bottom portion. Therefore, this Kanji character contains a total of eight horizontal strokes. To express eight horizontal strokes, 16 dots are needed, including the white portions between the horizontal strokes. A bit map image of 16.times.16 dots is therefore the smallest size that can be expressed correctly.
If the Kanji character is reduced to physical coordinates of 12.times.12 dots, some horizontal strokes will contact with each other as shown in FIG. 4B because there are no dots to express white space between the horizontal strokes.
When a character designed in thick lines, like a Gothic character, is reduced, some horizontal strokes will contact with each other, as shown in FIG. 2B. The contacted portion appears smeared out in black, and the character will not be recognized accurately, thus impairing the readability.
Likewise, when a character which has a complex design even with thin lines, is reduced, some horizontal strokes will contact with each other, as shown in FIG. 4B. The contacted portion also appears smeared out in black, so that the character will not be recognized accurately, thus impairing the readability.
Further, individual points (contour points) which constitute a Kanji character "Me" expressed in an outline form as shown in FIG. 5, are stored by integer logical coordinates like 1000.times.1000. For instance, to convert this Kanji character to a character size of 12.times.14 dots, the left vertical stroke of the Kanji character "Me" is expressed by X coordinates e=1.2 to e'=2.7 through coordination conversion as shown in FIG. 6A. Through a rounding process, this vertical stroke becomes a bit map image having a width of two pixels from 1 to 3 in X coordinates as shown in FIG. 6B. The right vertical stroke of the Kanji character "Me" is expressed by X coordinates f=7.7 to f'=9.2. Through a rounding process, this vertical stroke becomes a bit map image having a width of one pixel from 8 to 9 in X coordinates as shown in FIG. 6B.
In this manner, even the vertical strokes which originally have the same width will have different widths, two pixels on the left-hand side and one pixel on the right-hand side, on physical coordinates through a rounding process.
Likewise, through coordinate conversion, the four horizontal strokes of the Kanji character "Me" are expressed by Y coordinates of d=11.5 to d'=12.7, c=8.3 to c'=9.5, b=4.5 to b'=5.7 and a=0.3 to a'=1.5 in the top-to-down order, respectively, as shown in FIG. 6A. Through rounding, as shown in FIG. 6B, those strokes are respectively expressed by d=12 to d'=13, c=8 to c'= 10, b=5 to b'=6 and a=0 to a'=2. That is, the horizontal strokes respectively have line widths of one pixel, two pixels, one pixel, and two pixels.
Although those horizontal strokes have the line width of "1.2," two of their line widths will become one pixel and the other line widths two pixels through a rounding process.
For a bit map font developed from an outline font, since this width difference will change the impression of a character, it should be made as small as possible.
As a solution to this problem, a line-width retaining rounding process as shown in FIGS. 7A and 7B has been proposed. This method is to round one of the top and bottom contour lines of a horizontal stroke or one of the right and left contour lines of a vertical stroke by priority, and is to round the other contour line while keeping the line width.
Of the Kanji character "Me" after coordinate conversion shown in FIG. 7A, a, b, c, d, e and f are the contour lines that are to be rounded by priority, and a', b', c', d', e' and f' are the contour lines that are to be rounded while keeping their line widths intact. First, the contour line of the bottom horizontal stroke expressed by the Y coordinate a is rounded, and "0.3" becomes "0" through the rounding process.
Then, the contour line of the bottom horizontal stroke expressed by the Y coordinate a' is rounded. As the line width is kept at this time, the difference of "-0.3" originated from the rounding of a from 0.3 to 0 is added to the Y coordinate of a', and a'=1.5-0.3=1.2. Thus, the line width becomes one pixel through the rounding process.
Likewise, the Y coordinate of the contour line d for the topmost horizontal stroke is "11.5" and becomes "12" through rounding. The Y coordinate of the contour line d' becomes 12.7+0.5 (difference)=13.2 in accordance with the line-width retaining process. Thus, the Y coordinate becomes "13" through the rounding process, and the line width becomes one pixel. The Y coordinate of the contour line c for the second horizontal stroke from the topmost one is "8.3" and becomes "8" through rounding. The Y coordinate of the contour line c' becomes 9.5-0.3 (difference)=9.2 in accordance with the line-width retaining process. Thus, the Y coordinate becomes "9" through the rounding process, and the line width becomes one pixel. The Y coordinate of the contour line b for the third horizontal stroke is "4.5" and becomes "5" through rounding. The Y coordinate of the contour line b' becomes 5.7-0.5 (difference)=6.2 in accordance with the line-width retaining process. Thus, the Y coordinate becomes "6" through the rounding process, and the line width becomes one pixel. In this manner, the line widths of the horizontal strokes all become one pixel, closest to the original width of 1.2. Similarly, the line widths of the vertical strokes become two pixels as shown in FIG. 7B.
Although the line widths of the horizontal strokes becomes the same in this method, the intervals between those horizontal strokes become three pixels, two pixels and four pixels from the top, as shown in FIG. 7B. Those intervals will be compared with the original intervals. As shown in FIG. 7A, the stroke intervals in the top-to-bottom order before the rounding are d-c'=11.5-9.5=2.0, c-b'=8.3-5.7=2.6, and b-a'=4.5-1.5=3.0. That is, while the original intervals of the horizontal strokes become wider in the top-to-bottom order, the intervals after rounding become wider in the order of the middle stroke, the top stroke and the bottom stroke, and the order has changed.
More specifically, while the interval between the positions c' and d is originally 2.0, it is reproduced to be three pixels. While the interval between the positions b' and c is originally 2.6, it has become two pixels. For a character having many horizontal strokes and vertical strokes, it is important to precisely reproduce the line widths and stroke intervals in particular to provide a character expressed by logical coordinates in order to improve the character quality. However, even through the line widths are improved, the intervals are not adjusted properly.